package com.client;

import org.apache.log4j.Logger;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息消费者
 * @RabbitListener注解定义该类对指定名称队列的监听
 */
@Component
@RabbitListener(queues = "addResult")
public class Receiver {
    private final Logger logger = Logger.getLogger(getClass());

    @RabbitHandler
    public void process(Integer r) {
        logger.info("Receiver : " + r);
    }
}
